﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Data;
using DAL;
using DLL;
namespace BLL.教师操作BLL
{
    public class AddStudentBLL
    {
        public AddStudent addStudent= null;

        #region 获取学院信息
        /// <summary>
        /// 获取学院信息
        /// </summary>
        /// <returns></returns>
        public DataTable getCollegeInfo()
        {

            addStudent = new AddStudent();
            DataTable dt_College = addStudent.getCollegeInfo();

            return dt_College;
        }
        #endregion

        #region 添加学生信息
        /// <summary>
        /// 添加学生信息
        /// </summary>
        /// <param name="studentInfo"></param>
        /// <returns></returns>
        public bool addStudentInfo(StudentInfoEntity studentInfo)
        {
            //实例化D层
            addStudent = new AddStudent();
            int flag = addStudent.AddStudentInfo(studentInfo);
            if (flag> 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        #endregion

        #region 根据学院名字选择对应学院下拉框的专业---吕德彪--2018
        /// <summary>
        /// 根据学院名字选择对应学院下拉框的专业---吕德彪--2018
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable SelectMajorByCollegeName(TimeEntity timeEntity)
        {
            addStudent = new AddStudent();
            DataTable majortable = addStudent.SelectMajorByCollegeName(timeEntity);

            return majortable;
            
        }
        #endregion

        #region 查询IP填充下拉框查询，重复字段只保留一个--吕德彪--2018
        /// <summary>
        /// 查询IP填充下拉框---吕德彪--2018
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable SelectIP()
        {
            addStudent = new AddStudent();
            DataTable dt = addStudent.SelectIP();
            
            return dt;
        }
        #endregion

        #region 批量导入学生--吕德彪-2018.04.29
        /// <summary>
        /// 批量导入学生
        /// </summary>
        /// <returns></returns>
        public bool AddGroupStudent(DataTable dt)
        {
            addStudent = new AddStudent();
            int flag = addStudent.AddGroupStudent(dt);
            if (flag > 0)
            {
                return true;
            }
            else
            {
                return false;
            }            
        }
        #endregion

        #region 查询批量导入的学生是否存在-吕德彪-2018.04.29
        /// <summary>
        /// 查询批量导入的学生是否存在
        /// </summary>
        /// <param name="studentInfo"></param>
        /// <returns></returns>
        public DataTable SelectStudent(StudentInfoEntity studentInfo)
        {
            addStudent = new AddStudent();
            DataTable dt = addStudent.SelectStudent(studentInfo);
            return dt;
        }
        #endregion
    }
}
